package com.changil.nowonchangil.api;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

import com.changil.nowonchangil.controller.ServiceController;
import com.changil.nowonchangil.dto.User;

@Path("/users")
public class UserApi {
	private ServiceController controller = new ServiceController();

	public void SetScoreService(ServiceController controller) {
		this.controller = controller;
	}

	@POST
	@Produces(MediaType.APPLICATION_JSON)
	@Path("login")
	public User login(
			@FormParam("id") String id,
			@FormParam("password") String password) {
		System.out.println("패스워드느 "+password);
		User result = new User();
		result = controller.login(id, password);
		return result;
	}
}
